/**
 * Car.java
 *
 *
 *
 * @author HongKai Guo
 * @version 1.00 2011/4/5
 */
import java.util.Random;


public class Car {
    private int col;
    private int row;
    Random random = new Random();    //using random

    //setter

    /**
     * set Car row
     */
    public void setRow(int row){
        this.row = row;
    }

    /**
     * set Car column
     */
    public void setCol(int col){
        this.col = col;
    }

    //getter

    /**
     * get Car row
     */
    public int getRow(){
        return row;
    }

    /**
     * get Car column
     */
    public int getCol(){
        return col;
    }

    //random amount of Car

    /**
     * Generate random number of Cars
     */
    public int GenerateCarRandNum(){
        int num = 1 + random.nextInt(9);
        return num;
    }

    //random Car row position

    /**
     * Generate car position(row)
     */
    public int GenerateRandCarPosrow(int gridSize){
        int num = 1 + random.nextInt((gridSize-1));
        return num;
    }

    //random Car column position

    /**
     * Generate car position(column)
     */
    public int GenerateRandCarPoscol(int lane,int middle){
        int num = middle + random.nextInt(lane);
        return num;
    }


}
